<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">账号管理</h4>
</div>
<div class="wrapper-md ng-scope">
    <div class="panel panel-default"  ng-controller="accountInternalCtrl">
        <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline">
                    <div class="form-group">
                        <label class="control-label">手机号码</label>
                        <input ng-model="systemUser.mobilePhone" type="text" class="input-sm form-control">
                    </div>
                    <button ng-click="query()" class="btn btn-sm btn-default">查询</button>
                </form>
            </div>
            <div class="col-sm-3">
                <div class=" pull-right">
                    <a ui-sref="app.accountCreate({type:systemUser.type})" class="btn btn-sm btn-info" target="_blank">添加账号</a>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                    <tr>
                        <th>账号/手机</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>Email</th>
                        <th>角色</th>
                        <th>状态</th>
                        <th width="180" class="text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="u in list">
                        <td>+86-{{u.mobilePhone}}</td>
                        <td>{{u.name}}</td>
                        <td ng-bind="{0:'女士',1:'先生'}[u.gender]"></td>
                        <td>{{u.email}}</td>
                        <td>
                            <span class="label bg-primary">{{u.roleName}}</span>
                        </td>
                        <td>
                            <span class="label bg-success" ng-if='u.status==0'>正常</span>
                            <span class="label bg-light dk" ng-if='u.status==1'>停用</span>
                        </td>
                        <td class="t-btns text-center">
                            <div ng-if="u.isCurrentAccount==0">
                                <a ui-sref="app.accountInternalEdit({systemUserId:u.id})" class="btn btn-sm btn-info" target="_blank">修改</a>
                                <div class="btn-group dropdown" dropdown="">
                                    <button class="btn btn-sm btn-default" dropdown-toggle=""
                                            aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li ng-click="updateSystemUserStatus(u.id,u.status)"><a href="" ng-bind="{0:'冻结',1:'解禁'}[u.status]">冻结</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div ng-if="u.isCurrentAccount==1">
                                <span class="badge bg-success">当前帐号</span>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                <span class="h6">~未搜索到任何数据~</span>
            </div>
            <div>
                <circle-loading ng-if="app.loading"></circle-loading>
            </div>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-offset-4 col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>
</div>
